//
//  UserData.m
//  QSBK
//
//  Created by Eric Wang on 4/24/15.
//  Copyright (c) 2015 Eric Wang. All rights reserved.
//

#import "UserData.h"

@implementation UserData
-(id)initWithCoder:(NSCoder *)aDecoder
{
//{@property(nonatomic,assign)int articles_a;
//    @property(nonatomic,assign)int articles_t_all;
//    @property(nonatomic,assign)int articles_t;
//    @property(nonatomic,copy)NSString *token;
//    @property(nonatomic,strong)User *user;
//    @property(nonatomic,assign)int im;
    self = [super init];
    if(self)
    {
        _articles_a = [[aDecoder decodeObjectForKey:@"articles_a"] intValue];
        _articles_t = [[aDecoder decodeObjectForKey:@"articles_t"]intValue];
        _articles_t_all = [[aDecoder decodeObjectForKey:@"articles_t_all"]intValue];
        _token = [aDecoder decodeObjectForKey:@"token"];
        _user = [aDecoder decodeObjectForKey:@"user"];
        _im = [[aDecoder decodeObjectForKey:@"im"] intValue];
        
    }
    return self;

}
-(void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:@(_articles_a) forKey:@"articles_a"];
    [aCoder encodeObject:@(_articles_t) forKey:@"articles_t"];
    [aCoder encodeObject:@(_articles_t_all) forKey:@"_articles_t_all"];
    [aCoder encodeObject:_token forKey:@"token"];
    [aCoder encodeObject:_user forKey:@"user"];
    [aCoder encodeObject:@(_im) forKey:@"im"];
}
@end
